<template>
  <div>
    <v-title></v-title>
    <v-back></v-back>
  </div>
</template>
  
  <script>
export default {
  mounted() {
    console.log(this.$route.query);
  },

  //-----组件守卫-------
  beforeRouteEnter(to,from,next){
    console.log("组件守卫-前置-去哪",to.path);
    console.log("组件守卫-前置-来着",from.path);
    //如果是分类跳转来的，就让他看，否则就去首页
    if(from.path == "/index/sort"){
      next();
    }else{
      next("/index/home")
    }
    
  },

  //组件内部更新之前
  beforeRouteUpdate(to,from,next){
    console.log("组件守卫-组件内部更新之前-去哪",to.path);
    console.log("组件守卫-组件内部更新之前-来着",from.path);
    next();
  },


  // afterRouteEnter(to,from,next){
  //   console.log("组件守卫-前置-去哪",to.path);
  //   console.log("组件守卫-前置-来着",from.path);
  // }

};
</script>
  
  <style>
</style>